package controller;


import service.Impl.ProvinceServiceImpl;
import service.ProvinceService;
import servlet.BaseServlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/province")
public class ProvinceController extends BaseServlet {

    private ProvinceService provinceService = new ProvinceServiceImpl();

    public void getProvinces(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String provinces = provinceService.getProvinces();
        response.getWriter().write(provinces);
    }

    public void getCities(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String cities = provinceService.getCities(request);
        response.getWriter().write(cities);
    }
}
